import { Button } from 'antd';
import React from 'react';
import { withNativeProps } from '../utils/native-props';
import './index.less';
var Page = function Page(props) {
  var children = props.children,
    breadcrumb = props.breadcrumb,
    _props$breadcrumbPadd = props.breadcrumbPadding,
    breadcrumbPadding = _props$breadcrumbPadd === void 0 ? 20 : _props$breadcrumbPadd,
    pageInnerStyle = props.pageInnerStyle,
    operations = props.operations,
    operationsStyle = props.operationsStyle,
    backButton = props.backButton,
    extra = props.extra;
  return withNativeProps(
    props,
    /*#__PURE__*/ React.createElement(
      'div',
      {
        className: 'szzj-page',
        style: {
          // 没有面包屑的情况只能为 0，有面包屑的情况会取 breadcrumbPadding，默认为 20
          paddingTop: breadcrumb ? 0 : breadcrumbPadding,
          paddingBottom: operations ? 84 : 20,
        },
      },
      breadcrumb &&
        /*#__PURE__*/ React.createElement(
          'div',
          {
            className: 'szzj-page-header',
          },
          breadcrumb,
          /*#__PURE__*/ React.createElement(
            'div',
            {
              className: 'szzj-page-header-operations',
            },
            extra &&
              /*#__PURE__*/ React.createElement(
                'div',
                {
                  className: 'szzj-page-header-operations-more',
                },
                extra,
              ),
            backButton &&
              /*#__PURE__*/ React.createElement(
                Button,
                {
                  className: 'szzj-page-back-button',
                  onClick: function onClick() {
                    window.history.go(-1);
                  },
                },
                '\u8FD4\u56DE',
              ),
          ),
        ),
      /*#__PURE__*/ React.createElement(
        'div',
        {
          className: 'szzj-page-inner',
          style: pageInnerStyle,
        },
        children,
      ),
      operations &&
        /*#__PURE__*/ React.createElement(
          'div',
          {
            className: 'szzj-page-operations',
            style: operationsStyle,
          },
          operations,
        ),
    ),
  );
};
export default Page;
